package cn.abcsys.cloud.devops.web.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.abcsys.cloud.devops.web.util.Result;

@Controller
@RequestMapping(value="/area")
public class AreaController {
	
	@RequestMapping(value="/changeArea",method={RequestMethod.POST})
	@ResponseBody
	public Result changeArea(HttpServletRequest request,@RequestBody Map<String,String> map){
		String areaFlag = map.get("areaFalg");
		if(null == areaFlag)
			return new Result(false, "请选择相应的地域");
		
		request.getSession().setAttribute("areaFlag", areaFlag);
		return new Result(true, "地域切换成功");
		
	}
}
